#pragma once

#include <chrono>
#include <functional>
struct timer_event
{
    timer_event() : id_(++id_counter)
    {
        trigger_time = std::chrono::nanoseconds(std::chrono::system_clock::now().time_since_epoch()).count() / 1000000;
    }
    long long             trigger_time;  // ms精度
    int                   interval;
    std::function<void()> func;

    int id() const
    {
        return id_;
    }

  private:
    int id_;

    static int id_counter;
};
